﻿using System;
using BT.Engine.Components;

namespace BT.Engine
{
    public class Player
    {

        public PlayerState State { get; private set; }

        public int Index { get; set; }

        public int Immunity { get; private set; }

        public int Score { get; private set; }

        private bool[] tools;

        public Player()
        {
            State = PlayerState.Running;
            tools = new bool[Enum.GetValues(typeof(ToolType)).Length];
        }

        public void UpdateState(Input input)
        {

        }

        public Item[] CheckCollision(Item[,] items)
        {
            Item[] collided = new Item[3];
            return collided;
        }

        private void MoveItem(Item[,] items, Item[] collided, int level)
        {
            collided[level] = items[level, Index];
            items[level, Index] = null;
        }

        public void AddTool(Tool tool)
        {
            tools[(int)tool.Type] = true;
        }

        public bool HasTool(ToolType type)
        {
            return tools[(int)type];
        }

    }
}
